package com.janko.springbootbase.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;


/**
 * 用户基础类
 *
 * @Data就是帮助生成get/set方法，
 * @AllArgsConstructor和@NoArgsConstructor是全参构造和无参构造，
 * @ToString是覆盖默认toString方法，
 * @Accessors(chain = true)
 */
@Data
@AllArgsConstructor  //全构参数
@NoArgsConstructor //无垢参数
@Accessors(chain = true)  //返回当前对象  例如:new User().set().set();
@TableName(value = "tb_user")
public class BaseUser {
    private int id;
    private String name;
    private int age;
    private String address;
    private int is_del;
    @TableField(exist = false)
    private String is_delete_display;

    public String getIs_delete_display() {
        if (is_del == 0) return "未删除";
        return "已删除";
    }

    public void setIs_delete_display(String is_delete_display) {
        this.is_delete_display = is_delete_display;
    }
}
